import api from '@/http/index'

/* 列表 */
export const getTablesList = (data) => {
    return new Promise((resolve, reject) => {
        api.get('/api/Information/GetGridJson', data).then((res) => {
            resolve(res);
        }).catch(err => {
            reject(err)
        })
    });
};

/* 新建 */
export const addTablesItem = (data) => {
    return new Promise((resolve, reject) => {
        api.post('/api/Information/SubmitForm', data).then((res) => {
            resolve(res);
        }).catch(err => {
            reject(err)
        })
    });
};
// 删除新闻
export const deleteItem = (data) => {
    return new Promise((resolve, reject) => {
        api.get('/api/Information/DeleteForm', data).then((res) => {
            resolve(res);
        }).catch(err => {
            reject(err)
        })
    });
};
// 获取一个
export const getItemInfo = (data) => {
    return new Promise((resolve, reject) => {
        api.get('/api/Information/GetForm', data).then((res) => {
            resolve(res);
        }).catch(err => {
            reject(err)
        })
    });
};
// 获取栏目

export const getNtype = (data) => {
    return new Promise((resolve, reject) => {
        api.get('/api/ClientsData/GetSelectJson', data).then((res) => {
            resolve(res);
        }).catch(err => {
            reject(err);
        })
    });
};